package com.qitmiaojie.controller;

import com.qitmiaojie.controller.utils.Result;
import com.qitmiaojie.service.QiniuService;
import com.qitmiaojie.utils.QiniuUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.UUID;

/**
 * @author miaojie
 * @version 1.0
 * @description TODO
 * @date 2023/3/10 19:52
 */
@RestController
@Slf4j
@RequestMapping("/qiniu")
public class QiniuController {

    @Autowired
    private QiniuService qiniuService;

    @PostMapping("/upload")
    public Result journey(@RequestBody MultipartFile file){
        return qiniuService.upload(file) ;
    }
}
